<#include "../header.html">
<script type="text/javascript" src="js/addr.js"></script>
<script type="text/javascript">
	$(function(){
		//用户的省市区信息加载
		(new Addr("sheng", "shi", "xian")).initLoad();
	});
</script>
<div class="c_nav">
	<span>管理选项：</span>
	<a href="baseAction.do?method=query">管理首页</a>
	<a href="javascript:location.reload()"> | [刷新页面]</a>
</div>
<div class="c_box bg_white">
<form id="addForm" name="addForm" action="baseAction.do?method=save" method="post">
	<div class="c_topic"><#if base.id??>修改<#else>新增</#if>基站</div>
	<input type="hidden" name="bid" id="bid" value="${base.id!}"/>
	<div class="c_form_3 c_form-label-8">
	<ul class="l_mb">
		<li>
			<span class="e_label e_label-required">基站名称：</span>
			<span class="e_input">
				<input type="text" name="bname" id="bname" desc="基站名称" nullable="no" maxlen="40" maxlength="40" value="${base.bname!}"/>
			</span>
		</li>
		<li>
			<span class="e_label e_label-required">商圈：</span>
			<span class="e_input">
				<input type="text" name="businessCircle" id="businessCircle" desc="商圈" nullable="no" maxlen="100" maxlength="100"   value="${base.businessCircle!}" />
			</span>
		</li>
		<li>
			<span class="e_label e_label-required">联系电话：</span>
			<span class="e_input">
				<input type="text" name="tel" id="tel" desc="联系电话" nullable="no" maxlen="20" maxlength="20" datatype="basechar"  value="${base.tel!}" />
			</span>
		</li>
	</ul>
	<ul class="l_mb">
		<li>
			<span class="e_label e_label-required">地址：</span>
			<span class="c_form-col-3">
				<select name="sheng" id="sheng" desc="省" nullable="no">
					<option value="${base.sheng!}">省份</option>
				</select>
				<select name="shi" id="shi" desc="市" nullable="no">
					<option value="${base.shi!}">城市</option>
				</select>
				<select name="xian" id="xian" desc="县/区" >
					<option value="${base.xian!}">区县</option>
				</select>
			</span>
		</li>
		<li>
			<span class="e_label e_label-required">详细地址：</span>
			<span class="e_input">
				<input type="text" name="addr" id="addr" desc="详细地址" nullable="no" value="${base.addr!}" maxlen="50" maxlength="50"/>
			</span>
		</li>
	</ul>
	<ul class="l_mb">
		<li>
			<span class="e_label e_label-required">最大预约数：</span>
			<span class="e_input">
			<input type="text" name="mustAmount" id="mustAmount" desc="最大预约数" nullable="no" maxlen="40" maxlength="40" datatype="number" value="${base.mustAmount!}"/>
		</span>
		</li>
		<li>
			<span class="e_label e_label-required">经度：</span>
			<span class="e_input">
			<input type="text" name="longitude" id="longitude" desc="经度" nullable="no" maxlen="100" maxlength="100" datatype="numeric"  value="${base.longitude!}" />
			</span>
		</li>
		<li>
			<span class="e_label e_label-required">纬度：</span>
			<span class="e_input">
				<input type="text" name="latitude" id="latitude" desc="纬度" nullable="no" maxlen="100" maxlength="100" datatype="numeric"  value="${base.latitude!}" />
			</span>
		</li>
	</ul>
	<ul class="l_mb">
		<li>
			<span class="e_label e_label-required">非会员马力：</span>
			<span class="e_input">
				<input type="text" name="baseMali" id="baseMali" desc="非会员马力" nullable="no" maxlen="10" maxlength="10" datatype="number" value="${base.baseMali/100.0!}"/>
			</span>
		</li>
		<li>
			<span class="e_label e_label-required">会员马力：</span>
			<span class="e_input">
				<input type="text" name="vipMali" id="vipMali" desc="会员马力" nullable="no" maxlen="10" maxlength="10" datatype="numeric"  value="${base.vipMali/100.0!}" />
			</span>
		</li>
	</ul>
	<ul class="l_mb">
		<li>
			<span class="e_label e_label-required">最大修路人数：</span>
			<span class="e_input">
			<input type="text" name="maxVip" id="maxVip" desc="最大修路人数" nullable="no" maxlen="10" maxlength="10" min="${base.maxVip - base.residueVip!}" datatype="number" value="${base.maxVip!}"/>
		</span>
		</li>
		<li>
			<span class="e_label e_label-required">已有修路人数：</span>
			<span class="e_input">
				<input type="text" desc="已有修路人数" id="havaVip" nullable="no" maxlen="10" readonly="readonly" maxlength="10" datatype="number"  value="${base.maxVip - base.residueVip!}" />
			</span>
		</li>
		<li>
			<span class="e_label e_label-required">评分(1-10)：</span>
			<span class="e_input">
				<input type="text" desc="评分" id="grade" name="grade" nullable="no" maxlen="2"  maxlength="2" datatype="number"  value="${base.grade!}" />
			</span>
		</li>
	</ul>
	<ul class="l_mb">
		<li>
			<span class="e_label e_label-required">Logo：</span>
			<span class="e_input-file-btn">
				<input type="text" id="pic" name="pic" nullable="no" desc="logo" readonly="readonly" value="${base.pic!}"/>
				<input type="hidden" id="oldImgSrc" name="oldImgSrc" value="${base.pic!}"/>
				<input type="hidden" id="imgId" name="imgId" value=""/>
				<button type="button" id="uploadBtn" name="uploadBtn" class="e_btn">上传文件</button>
			</span>
		</li>
		<li class="e_red l_ml"></li>
	</ul>
	<ul class="c_form_3 c_form-label-8 l_mb">
		<li>
			<span class="e_label e_label-required">营业时间：</span>
			<span class="e_textarea">
				<textarea name="businessTime" id="businessTime" maxlen="20" maxlength="200" nullable="no">${base.businessTime!}</textarea>
			</span>
		</li>
		<li>
			<span class="e_label e_label-required">简介：</span>
			<span class="e_textarea">
			<textarea name="about" id="about" maxlen="255" maxlength="255" nullable="no">${base.about!}</textarea>
		</span>
		</li>
	</ul>
	</div>
	<div class="e_left">
		<button type="button" bind="" bindForm="addForm" class="e_btn-page">提交</button>
		<button type="reset" class="e_btn l_ml">重置</button>
	</div>
</form>
<#if base.id??>
<div class="c_box bg_white">
	<div class="c_topic">教练列表</div>
	<div class="c_table e_center l_mt">
		<table>
			<thead>
			<tr>
				<th></th>
				<th>名称</th>
				<th>性别</th>
				<th>电话</th>
				<th>费用(马力)</th>
			</tr>
			</thead>
			<tbody>
			<#list coachList as coach>
			<tr>
				<td><input type="checkbox" name="coachId" value="${coach.ID!}"></td>
				<td>${coach.name!}</td>
				<td><if><#if coach.sex?? && coach.sex?string == '1'>男<#elseif coach.sex?? && coach.sex?string == '2'>女</#if></td>
				<td>${coach.mobile!}</td>
				<td>${coach.mali/100.0!}</td>
			<tr>
			</#list>
			</tbody>
		</table>
	</div>
</div>
</#if>
</div>
<iframe id="uploadFrame" name="uploadFrame" src="baseAction.do?method=uploadFile&resultCode=-1" frameborder="0" class="e_hide"></iframe>
<script type="text/javascript">
$(function(){
	$("#uploadBtn").click(function(){
		$("#imgFile", window.uploadFrame.document).trigger("click");
	});
});
</script>
<#include "../footer.html">